﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LongNet.Util
{
    public class PageList
    {
        public static string FormatSql(int pagNumber, int rowCount,string tableName,string orderby)
        {
            string strsql = "select * from (select top " + (pagNumber * rowCount).ToString() + "row_number() over (order by " + orderby + ") as row ,* from " + tableName + ") a where row  between " + Convert.ToString((pagNumber - 1) * rowCount) + " and " + Convert.ToString(pagNumber * rowCount);
            return strsql;        
        }
        //public static int ()
    }
}
